/**
	License: 		Artistic license 2.0 (see license.txt, also available online at http://www.perlfoundation.org/artistic_license_2_0)
	Authors: 		OrbitalLab (http://www.orbitallab.ru/moonglide/), 2007-2009

	File:			demoscene.d
	Description:	custom scene with massive testing
	Date:			29.11.2007 by Digited
*/
module moonglide_demos.Main;

import
	moonglide.io.LogSystem,
	client.Application;

private
{
	CApplication app = null;
	int ReturnCode = 0;
}

//=================================================================
/// main - entry point
//=================================================================
int main( char[][] args )
{
	try
	{
		attentionLog( "\n\nStarting application...\n" );
		attentionLog( "Application launched with argument " ~ args[0] );

		app = new CApplication();

		if( app.initialize( args ) )
			app.run();

		ReturnCode = app.shutdown();
	}
	catch( Exception e )
	{
		errorLog( "main module caught error: " ~ e.msg );
		debug Cin.get;
		ReturnCode = -1;
	}
	finally
	{
		delete app;
	}

	attentionLogG( "Shutdown done!\n\nPress any key to exit...\n\n");
	Cin.get;

	return ReturnCode;
}
